<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>表单添加编辑渲染</title>
<{$showjs}>
<link rel="stylesheet" type="text/css" href="/Plug-in/ext/resources/css/xtheme-slate.css" />
<link rel="stylesheet" type="text/css" href="/css/main.css" />
<{section name=li loop=$plugcss}>
<link rel="stylesheet" type="text/css" href="<{$plugcss[li]}>" />
<{/section}>
<{section name=li loop=$plugurl}>
<script type="text/javascript" src="<{$plugurl[li]}>"></script>
<{/section}>
<style type="text/css">
.x-date-menu > ul{
display: inline;
}
.x-date-menu > ul li{
display: inline;
}
</style>
<script language="javascript">
Ext.onReady(function(){
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
var form = new Ext.form.FormPanel({
				renderTo:Ext.getBody(),
				bodyStyle:'padding:5px',
				height:parent.Ext.get('addWindow').getHeight()-34,
				labelWidth:55,
				border:false,
				autoScroll:true,
				labelAlign:'right',
				buttunAlign:'left',
				plain:true,
				frame:true,
        items:[{
        	xtype:'fieldset',
            title: '<{$action}>',
            autoHeight:true,
            bodyStyle:'padding:10px;',
            layout:'form',
            items:[
            {
						xtype:'hidden',
			            name: 'id',
			            value:'<{$id}>'
		    },{
						xtype:'hidden',
			            name: 'tree_id',
			            value:'<{$tree_id}>'
		    },
            <{section name=li loop=$js}>
				<{$js[li]}>
            <{if $smarty.section.li.index+1 < $js|@count}>,<{/if}><{/section}>
            ]
        }],
		buttons: [{
			xtype:'button',
            text: '保存',
            handler:function (){
								if(form.form.isValid()){
								<{$fckplugin}>
								form.form.doAction('submit',{
									url:'form_render.php',
									method:'POST',
									params:{require:'save'},
									waitMsg:'正在提交....',
									success:function(form,action){
											if (action.result.msg=='ok') {
												Ext.Msg.confirm('提示','成功!是否关闭本窗口?',function(a){
													if(a=='yes'){
													parent.gridrefresh();
													parent.Ext.getCmp('addWindow').close();
													}
												});

											} else {
												Ext.Msg.alert('提示',action.result.msg);
												Ext.get('username').select();
											}
									 }
									 ,
									 //提交失败的回调函数
									 failure:function(){
											Ext.Msg.alert('错误','数据提交错误！');
									 }
								})};
							}
        },{
        	xtype:'button',
            text: '取消'
        }]


});
<{section name=li loop=$plugjs}>
<{$plugjs[li]}>
<{/section}>
});
</script>
</head>
<body>
</body>
</html>